Memory units, or elements, in which data and execution code words are stored, have long been playing a major role in computer systems. This is even more so with the ongoing increase in the number of information to be processed and the growth in the amount of, and the rate at which, data is exchanged between computer systems. A typical computer application involves insertion and retrieval of data into/from a memory of a computer. Since, in many cases, computers are required to process data at very high speeds, fast and efficient insertions/retrievals of data to/from memories are a must.
Typically, a computer system has a memory unit with fixed size, and managing the content of the memory is relatively easy if the computer system is based on a single processor, or controller. However, in many cases, computer systems include two or more processors, generally referred to as “multi processor environment”, for enabling them to process, or handle, several tasks simultaneously. For example, one processor of a computer system may handle tasks relating to a display screen, whereas a second processor may handle tasks relating to multimedia data. A third processor may handle communications between the computer system and another computer system, and so on. Managing a physical memory that is shared by several processors is harder than managing a memory that is used by a single processor, because each processor has its own memory requirements. That is, each processor has to be able to store and fetch data from the shared physical memory without being interfered by, or interfering with, normal operation of other processors. A memory sharing methodology has to be applied in order to enable fast and efficient usage of a memory in a multi-processor environment.
A popular memory sharing methodology involves using a number of independent memory buffer pools while allocating the available memory space of a computer system among the memory buffer pools. Memory buffer pools may then be allocated to each processor according to its memory requirements. If a processor no longer needs (for a certain amount of time) a buffer pool allocated to it, the buffer pool may be de-allocated from it for the sake of another processor that might need it. The process of, and the considerations (or policy used) for, allocating and de-allocating memory buffer pools is generally termed “management of buffer pools”. De-allocating a memory buffer pool is also termed “freeing a memory buffer pool”.
The way memory buffer pools are managed greatly influences the performance of the computer system. In general, when adopting a particular memory buffers pools managing methodology, one has to factor in workload and system properties that may vary over time. Another major factor is response time, which is the time required, for example, for allocating (for or during a task being processed) a single buffer from the buffer pool or to release a buffer back to the free buffer pool. More about memory buffers pools may be found, for example, in “Autonomic Buffer Pool Configuration in PostgresSQL” by Wendy Powley et al. (School of Computing, Queen's University, Kingston, ON, Canada).
U.S. Pat. No. 6,931,497, by Clayton et al. (Aug. 16, 2005), discloses shared memory management utilizing a free list of buffers indices. U.S. Pat. No. 6,931,497 teaches “receiving a first buffer allocation command from a first processor, the allocation command including a register address associated with a pool of buffers in a shared memory, determining whether a buffer is available in the buffer pool based upon a buffer index corresponding to a free buffer, and if a buffer is determined available allocating the buffer to the first processor”. The solution disclosed by U.S. Pat. No. 6,931,497 includes using a cenfralized hardware implementation of a buffer manager, and a dedicated memory is used for the buffer pools management, which resides within the buffer manager.
U.S. Pat. No. 5,432,908, by Heddes et al. (Jul. 11, 1995), discloses high speed buffer management of share memory using linked lists and plural buffer managers for processing multiple requests concurrently. U.S. Pat. No. 5,432,908 teaches a buffer control memory having as many sections for buffer-control records as buffers which is employed together with a buffer manager, which is problematic because this solution necessitates a dedicated memory and buffer manager.
In a typical computer system, the processor(s) accesses the physical memory by using a direct memory access (“DMA”) engine. In general, whenever a processor needs to read (fetch) or to write (store) data from/to the physical memory, the processor forwards to the DMA engine a corresponding DMA-read or DMA-write request, whichever the case may be. If a processor issues a DMA-read request, the DMA seeks the requested data in the memory and fetches a copy thereof to the requesting processor. Likewise, if a processor issues a DMA-write request, the DMA seeks a free space in the memory and stores the data in the free space. However, using a DMA engine is costly in terms of processing time because a DMA request typically consumes several clock cycles. Therefore, an aspect of “good” management of memory buffer pools is associated with reducing the number of DMA requests that are issued by the processor(s).